package strategy;

/**
 * 策略模式中用一个Context对象来维护Strategy对象
 * @Author: Chen Guang
 * @Date: 2019/3/25 0025 上午 9:33
 */
public class Context {
    private Strategy strategy;

    public Context(Strategy strategy) {
        this.strategy = strategy;
    }

    /**
     * 上下文接口，通过调用该接口去实现不同算法
     */
    public void contextInterface(){
        strategy.algorithmInterface();
    }
}
